<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改文件')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-post-edit" th:object="${proFile}">
		<!--隐藏-->
		<input id="proId" name="proId" type="hidden" th:field="*{proId}"/>
		<div class="form-group">
			<label class="col-sm-3 control-label">文件名：</label>
			<div class="col-sm-8">
				<input class="form-control" type="text" name="proName" id="proName" th:field="*{proName}" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">开始时间：</label>
			<div class="col-sm-8">
				<input class="form-control" type="date" name="proBgTime" id="proBgTime" th:field="*{proBgTime}" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">结束时间：</label>
			<div class="col-sm-8">
				<input class="form-control" type="date" name="proOvTime" id="proOvTime" th:field="*{proOvTime}" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label ">项目简介：</label>
			<div class="col-sm-8">
				<input class="form-control" type="text" name="proDes" id="proDes" th:field="*{proDes}" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label ">项目负责人：</label>
			<div class="col-sm-8">
				<input class="form-control" type="text" name="proAthor" id="proAthor" th:field="*{proAthor}" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label ">施工地点：</label>
			<div class="col-sm-8">
				<input class="form-control" type="text" name="proAddress" id="proAddress" th:field="*{proAddress}" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">是否是标杆项目：</label>
			<div class="col-sm-8">
				<select name="proIsBench">
					<option value="0">是</option>
					<option value="1">否</option>
				</select>
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-3 control-label">项目类型：</label>
				<div class="col-sm-8">
					<select name="proTypeId">
						<option value="1">硬装</option>
						<option value="2">软装</option>
					</select>
				</div>
		</div>
	</form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
	var prefix = ctx + "pro/file";

	$("#form-post-edit").validate({
		onkeyup: false,
		rules:{
			postName:{
				remote: {
					url: ctx + "pro/file/checkFileNameUnique",
					type: "post",
					dataType: "json",
					data: {
						"proName" : function() {
							return $.common.trim($("#proName").val());
						}
					},
					dataFilter: function(data, type) {
						return $.validate.unique(data);
					}
				}
			},
			postSort:{
				digits:true
			},
		},
		messages: {
			"proName": {
				remote: "文件名称已经存在"
			}
		},
		focusCleanup: true
	});

	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(prefix + "/edit", $('#form-post-edit').serialize());
		}
	}
</script>
</body>
</html>
